from logging import *
import logging
import datetime

logger_level = DEBUG  # CRITICAL = 50 FATAL = CRITICAL ERROR = 40 WARNING = 30
                      # WARN = WARNING INFO = 20 DEBUG = 10 NOTSET = 0
info_formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
error_formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(filename)s[:%(lineno)d] - %(message)s')

logger = logging.getLogger("main_logger")
logger.setLevel(level=logger_level)

info_handler = logging.FileHandler("..\script\log\info_log.txt")
info_handler.setLevel(logging.INFO)
info_handler.setFormatter(info_formatter)

error_handler = logging.FileHandler("..\script\log\error_log.txt")
error_handler.setLevel(logging.ERROR)
error_handler.setFormatter(error_formatter)

logger.addHandler(info_handler)
logger.addHandler(error_handler)
